<!-- <template>
  <view class="container">
    <button class="import-btn" @click="chooseWordFile">导入Word文档</button>
    <view v-if="savedPath" class="path-display">
      <text class="label">已保存路径：</text>
      <text class="path">{{ savedPath }}</text>
    </view>
    <view v-if="errorMsg" class="error-msg">{{ errorMsg }}</view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      savedPath: '',
      errorMsg: '',
      isLoading: false
    }
  },
  methods: {
    // 选择文件方法
    chooseWordFile() {
      if (typeof plus === 'undefined') {
        this.showError('只能在App中使用此功能')
        return
      }
	//从本地选择文件
      uni.chooseFile({
		count: 6, //默认100
		extension:['.docx'],
		success: function (res) {
			console.log(JSON.stringify(res.tempFilePaths));
		}
      })
	},
  onLoad() {
    const path = uni.getStorageSync('wordPath')
    if (path) {
      this.savedPath = plus.io.convertLocalFileSystemURL(path)
    }
  },
  beforeDestroy() {
    uni.hideLoading()
  }
}
</script>

<style scoped>
.container {
  padding: 20px;
}

.import-btn {
  margin: 20px 0;
  padding: 12px 24px;
  background-color: #007AFF;
  color: white;
  border-radius: 8px;
}

.path-display {
  margin-top: 20px;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 6px;
}

.label {
  font-weight: bold;
  color: #333;
}

.path {
  color: #666;
  word-break: break-all;
}

.error-msg {
  margin-top: 15px;
  color: #ff4444;
  font-size: 14px;
}
</style> -->